solving systems of equations with 3 variables